extends "../kaixuan-3/kaixuan-3.gd"


var baseId = ""
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("每{cd}秒尝试向敌方护甲最低的单位发起突击，并获得2层<模糊><圣盾>", "冲锋号角", "cfhj", 5)

var upText1 = "剑刃风暴伤害提高30%"
var upText2 = "剑刃风暴范围+1"

func _castCdSkill(id):
	._castCdSkill(id)
	if id == "cfhj":
		cfhj()

func cfhj():
	addBuff(buff.b_moHu.new(2))
	var chas = getAllChas(1)
	chas.sort_custom(self, "sort")
	for cha in chas:
		if cha.isDeath || cha.isSumm:continue
		var mv = Vector2(cha.cell.x ,cha.cell.y)
		for i in config.aroundCells:
			var v = mv+i
			if matCha(v) == null && sys.main.isMatin(v) and setCell(v):
				var pos = sys.main.map.map_to_world(cell)
				ying(pos)
				position = pos
				aiCha = cha
				buff.addShengDun(self, 2)
				return
